@extends('layouts._app')
@section('content')
    <body>
    <div class="layui-tab page-content-wrap">
        <div class="layui-form-item">
            <div class="layui-inline tool-btn">
                <a class="layui-btn layui-btn-small layui-btn-primary" id='email-refresh-btn'
                   href="{{route('blog.config.index')}}" data-title='刷新'>
                    <i class="layui-icon">&#x1002;</i>
                </a>
            </div>
        </div>
        <ul class="layui-tab-title">
            <li class="layui-this">站点配置</li>
            <li>SEO配置</li>
            <li>公司信息</li>
            <li>网站图标</li>
            <li>系统数据</li>
        </ul>
        <div class="layui-tab-content">
            @include('layouts._flash')
            <div class="layui-tab-item layui-show">
                {!! Form::open(['route' => ['blog.config.store'],'class'=>'layui-form','style'=>'width: 90%;padding-top: 20px;','method'=>'post']) !!}
                {!! Form::hidden('filter','true') !!}
                {!! Form::hidden('status',1) !!}
                {!! Form::hidden('submit','9') !!}
                <div class="layui-form-item">
                    {!! Form::label('','网站名称：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('name',"{$blogConfigTitle->name}",['id'=>'name','class'=>'layui-input','placeholder'=>'请输入网站名称']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','网站域名：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('url',"{$blogConfigTitle->url}",['class'=>'layui-input','placeholder'=>'请输入网站域名']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','站长邮箱：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-inline">
                        {!! Form::email('box',"{$blogConfigTitle->box}",['id'=>'email_9','class'=>'layui-input','placeholder'=>'请输入联系邮箱']) !!}
                    </div>
                    <a href="javascript:void(0);" onclick="captcha('0',9,'{{route('code')}}','{{ csrf_token() }}')"
                       id="code_de_9"
                       style="margin:10px;text-align: center">发送验证码</a>
                    <span style="color: red">注：无更改无需发送</span>
                </div>
                <div class="layui-form-item" id="email_code_9" style="display: none;">
                    {!! Form::label('','邮箱验证码：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-inline">
                        {!! Form::text('code','',['id'=>'code_9','class'=>'layui-input','readonly','placeholder'=>'无更改无需填写']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','备案信息：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('record',"{$blogConfigTitle->record}",['class'=>'layui-input','placeholder'=>'请输入备案信息']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','版权信息：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('info',"{$blogConfigTitle->info}",['class'=>'layui-input','placeholder'=>'请输入版权信息']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        {!! Form::submit('立即提交',['class'=>'layui-btn layui-btn-normal','lay-filter'=>'siteInfo','lay-submit']) !!}
                    </div>
                </div>
                {!! Form::close() !!}
            </div>
            <div class="layui-tab-item">
                {!! Form::open(['route' => ['blog.config.store'],'class'=>'layui-form','style'=>'width: 90%;padding-top: 20px;','method'=>'post']) !!}
                {!! Form::hidden('filter','true') !!}
                {!! Form::hidden('status',2) !!}
                <div class="layui-form-item">
                    {!! Form::label('','SEO标题：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('title',"{$blogConfigTitle->title}",['placeholder'=>'请输入seo标题','class'=>'layui-input']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','关键字：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('word',"{$blogConfigTitle->word}",['placeholder'=>'请输入seo关键字','class'=>'layui-input']) !!}
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    {!! Form::label('','描述：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::textarea('riptive',"{$blogConfigTitle->riptive}",['placeholder'=>'请输入seo描述','style'=>'height: -webkit-fill-available;','class'=>'layui-textarea']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        {!! Form::submit('立即提交',['class'=>'layui-btn layui-btn-normal','lay-filter'=>'seoInfo','lay-submit']) !!}
                    </div>
                </div>
                {!! Form::close() !!}
            </div>
            <div class="layui-tab-item">
                {!! Form::open(['route' => ['blog.config.store'],'class'=>'layui-form','style'=>'width: 90%;padding-top: 20px;','method'=>'post']) !!}
                {!! Form::hidden('filter','true') !!}
                {!! Form::hidden('status',3) !!}
                <div class="layui-form-item">
                    {!! Form::label('','公司名称：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('company',"{$blogConfigTitle->company}",['placeholder'=>'请输入公司名称','class'=>'layui-input']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','QQ：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('qq',"{$blogConfigTitle->qq}",['placeholder'=>'请输入QQ','class'=>'layui-input']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','手机号：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('phone',"{$blogConfigTitle->phone}",['placeholder'=>'请输入手机号','class'=>'layui-input']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','固定号码：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('fixed',"{$blogConfigTitle->fixed}",['placeholder'=>'请输入固定号码','class'=>'layui-input']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    {!! Form::label('','传真号码：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        {!! Form::text('fax',"{$blogConfigTitle->fax}",['placeholder'=>'请输入传真号码','class'=>'layui-input']) !!}
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        {!! Form::submit('立即提交',['class'=>'layui-btn layui-btn-normal','lay-filter'=>'companyInfo','lay-submit']) !!}
                    </div>
                </div>
                {!! Form::close() !!}
            </div>
            <div class="layui-tab-item">
                {!! Form::open(['route' => 'upload','class'=>'layui-form','style'=>'width: 90%;padding-top: 20px;','enctype'=>'multipart/form-data','method'=>'post']) !!}
                <div class="layui-form-item">
                    {!! Form::label('','网站图标：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        <div class="user-headface" style="width: 80px;">
                            <img title="网站图标" alt="{{$blogConfigTitle->name}}" id="img_show"
                                 style="margin:-10px;width: 60px;height: 60px;border-radius: 50%;"
                                 src="@if(isset($blogConfigTitle->file->url)){{assetImage($blogConfigTitle->file->url) ? : asset('static/admin/icon/35508.png')}}@else {{asset('static/admin/icon/35508.png')}}@endif">
                        </div>
                    </div>
                </div>
                <br>
                <div class="layui-form-item">
                    {!! Form::label('','上传：',['class'=>'layui-form-label']) !!}
                    <div class="layui-input-block">
                        <div class="layui-box layui-upload-button">
                            {!! Form::hidden('category','blogConfig') !!}
                            {!! Form::hidden('user','blog') !!}
                            {!! Form::hidden('get','file') !!}
                            {!! Form::file('file',['id'=>'file0','onchange'=>'previewImage(this,0)']) !!}
                            <span class="layui-upload-icon"><i class="layui-icon"></i>上传图片</span>
                        </div>
                    </div>
                </div>
                <br>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        {!! Form::submit('立即提交',['class'=>'layui-btn layui-btn-normal','lay-filter'=>'adminUpload','lay-submit']) !!}
                    </div>
                </div>
                {!! Form::close() !!}
            </div>
            <div class="layui-tab-item">
                {!! Form::open(['route' => ['blog.config.store'],'class'=>'layui-form','style'=>'width: 90%;padding-top: 20px;','method'=>'post']) !!}
                {!! Form::hidden('filter','true') !!}
                {!! Form::hidden('status',5) !!}
                <div class="layui-form-item">
                    {!! Form::textarea('config',"{$blogConfig}",['class'=>'layui-textarea','rows'=>'25']) !!}
                </div>
                <div class="layui-form-item">
                    {!! Form::submit('立即提交',['class'=>'layui-btn layui-btn-normal','lay-filter'=>'siteInfo','lay-submit']) !!}
                </div>
                {!! Form::close() !!}
            </div>
        </div>
    </div>
    <script src="{{asset('static/admin/layui/layui.js')}}" type="text/javascript" charset="utf-8"></script>
    <script src="{{asset('js/jquery.min.js')}}" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="{{asset('js/jquery.base64.js')}}"></script>
    <script type="text/javascript" src="{{asset('js/jquery.cookie.js')}}"></script>
    <script type="text/javascript" src="{{asset('js/upload.js')}}"></script>
    <script type="text/javascript" src="{{asset('js/common.js')}}"></script>
    <script>
        captchaInput(9);
        layui.use(['form', 'element'], function () {
            var form = layui.form();
            var element = layui.element();
            var textarea = $('textarea');
            textarea.scrollTop(textarea[0].scrollHeight);
            form.render();
            form.on('submit(siteInfo)', function (data) {
            });
        });
    </script>
    </body>
@endsection
